package com.reider.log4AS3.dataholder
{
	import com.reider.log4AS3.appenders.Appender;

	/**
	 * @private
	 */
	
    public class LoggerScope
    {
        private var _name:String;
        private var _level:Level
        private var _appenders:Array
        private var _isRoot:Boolean
        
        public function get name():String
        {
			return _name;
        }
        
        public function get level():Level
        {
			return _level;
        }
        
        public function get appenders():Array
        {
			return _appenders.concat();
        }
        
        public function get isRoot():Boolean
        {
			return _isRoot;
        }
        
        public function LoggerScope(isRoot:Boolean, name:String, level:Level, appenders:Array=null)
        {
			_isRoot = isRoot
			_name = name == "" ? null: name
			_level = level
			_appenders = appenders ? appenders.concat() : null
        }
		
		public function addLog(log:Log):void
		{
			for each(var appender:Appender in _appenders){
				appender.addLog( log )
			}
		}
    }
}